River crossing problem with solution